const HOST = require('../../config.js').host

Page({
    data:{
        stores: []
    },

    openMap (e) {
        wx.openLocation({
            latitude: parseFloat(e.currentTarget.dataset.lat),
            longitude: parseFloat(e.currentTarget.dataset.lon),
            scale: 28
        })
    },

    onLoad (options) {
        let id = options.id
        let self = this
     

        wx.request({
            url: HOST + 'v1/shop/queryByProductId/' + id,
            method: 'GET',
            success: function(res){
              if (res.data.sysCode === 1) {
                  self.setData({
                      stores: res.data.data
                  })
              }
            }
        })
    }
})